{
    interface EndInterface{
        end(): void
    }
    
    // 可以让动画接口继承end接口，也可以让类定义多个规范
    // interface AnimationInterface extends EndInterface{
    //     name: string
    //     move():void
    // }
    
    interface AnimationInterface{
        name: string
        move():void
    }
    
    abstract class Animations{
        protected getPos():{x:number;y:number}{
            return {x:100,y:300}
        }
    }
    
    class Tank extends Animations implements AnimationInterface,EndInterface{
        name:string = "敌方坦克"
        move():void{
            console.log(`${this.name}正在移动`)
        }
        end():void{
            console.log("游戏结束");
        }
    }
    
    // 既继承了抽象类，也被接口所约束
    class Player extends Animations implements AnimationInterface,EndInterface{
        name:string = "玩家"
        move():void{
            console.log(`${this.name}坦克正在移动`)
        }
        end():void{
            console.log("游戏结束");
        }
    }
    
    const tank = new Tank();
    tank.move();
    tank.end();
    
    const player = new Player();
    player.move();
    player.end();
}